package hieudao.exercise_collection.controllers;

import java.io.IOException;

import hieudao.exercise_collection.entity_data.Book;
import hieudao.exercise_collection.entity_data.BookManager;
import hieudao.exercise_collection.entity_data.Reader;
import hieudao.exercise_collection.models.LibraryManagementModel;

public class LibraryManagementController {
	LibraryManagementModel objModel = new LibraryManagementModel();
	Book book = new Book();
	Reader reader = new Reader();
	BookManager bookManager = new BookManager();

	public void executeByOption(String option) throws IOException {
		switch (Integer.parseInt(option)) {
		case 1: { // Execute input and display information about Book
			objModel.inputBookInfo(book);
			objModel.displayBookInfo(objModel.getLstBook());
			break;
		}
		case 2: { // Execute input and display information about Reader
			objModel.inputReaderInfo(reader);
			objModel.displayReaderInfo(objModel.getLstReader());
			break;
		}
		case 3: {
			objModel.inputReaderBookInfo(bookManager);
			objModel.displayReaderBookInfo(objModel.getLstBookManager());
		}
		}
	}
}
